package com.ocom.payhandle.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.entity.card.EntityUpgradePlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoUpgradePlan extends BaseMapper<EntityUpgradePlan> {


    @Select({"<script>",
            "select MAX(p.id) as id,p.plan_time,s.ms_ver " +
                    "FROM upgrade_plan p \n" +
                    "left join scale_upgrade  s on s.upgrade_code = p.upgrade_code  \n" +
                    "where s.status = 1  "+
                    " AND p.upgrade_code like concat(#{upgradeCode}, '%') "+
                    " GROUP BY p.upgrade_code " +
                    " ORDER BY id DESC " +
                    "</script>"})
    List<EntityUpgradePlan> getUpgradeVersion(String upgradeCode);
}
